package com.hxd.otc.module.wallet.presenter;

import com.hxd.otc.base.BaseBean;
import com.hxd.otc.module.wallet.bean.WalletCoinRecordBean;
import com.hxd.otc.module.wallet.contract.WalletCoinDetailContract;
import com.hxd.otc.module.wallet.model.WalletModel;
import com.hxd.otc.mvp.base.BasePresenter;
import com.hxd.otc.net.BaseObserver;

import java.util.List;

/**
 * 包  名 :  com.hxd.otc.mvp.wallet
 * 类  名 :  CoinRecordPresenter
 * 作  者 :  卫广玉
 * 时  间 :  2018/6/5 17:32
 * 描  述 :  钱包记录
 */
public class OneCoinTypeDetailPresenter extends BasePresenter<WalletCoinDetailContract.View> implements WalletCoinDetailContract.Presenter {

    private final WalletModel mModel;

    public OneCoinTypeDetailPresenter(WalletCoinDetailContract.View view) {
        super(view);
        mModel = WalletModel.getInstance();
    }

    @Override
    public void start() {

    }


    @Override
    public void doLoadData(long page, long size, String coinType) {
//        mModel.getWalletCoinRecord(new BaseObserver<List<WalletCoinRecordBean>>() {
//            @Override
//            public void onNext(String title, List<WalletCoinRecordBean> beans) {
//                doShowNoMore();
//                doSetAdapter(beans);
//            }
//
//            @Override
//            public void onError(int errType, String errMessage) {
//                mView.showToast(errMessage);
//                doShowNoMore();
//
//            }
//        }, mView.<BaseBean<List<WalletCoinRecordBean>>>bindAutoDispose(), page, size);
    }

    @Override
    public void doSetAdapter(List<WalletCoinRecordBean> data) {
        mView.getListData(data);
    }

    @Override
    public void doShowNoMore() {
        mView.onShowNoMore();
    }
}